Option Explicit On 
Option Strict On

Imports System

Public Class PlanarClass
    Private bMapProj As Boolean = False
    Private bGrid As Boolean = False
    Private bLocalP As Boolean = False
    Private Const nParam As Integer = 29
    Private sParams(nParam) As String
    'used for Map Projections and Grid Coordinate Systems
    'element 0 contains the name of the Map Projection or Grid System
    'elements 1-15 are possible parameters
    'maximum of 6 will be defined for Map Projections; maximum of 7 for Grid Systems
    Private sLocalDesc As String = ""
    Private sLocalGeoRef As String = ""
    Private sEncoding As String = ""
    Private bCoord As Boolean = False
    Private bBearing As Boolean = False
    Private dAbscissa As Decimal = 0
    Private dOrdinate As Decimal = 0
    Private dDistRes As Decimal = 0
    Private dBearingRes As Decimal = 0
    Private sBearUnits As String = ""
    Private sBearDirection As String = ""
    Private sBearMerid As String = ""
    Private sPlanarUnits As String = ""

    Public Sub New()
        MyBase.new()
        Dim iLoop As Integer = 0
        For iLoop = 0 To nParam
            sParams(iLoop) = ""
        Next
    End Sub

    Public ReadOnly Property nParams() As Integer
        Get
            nParams = nParam
        End Get
    End Property

    Public Property MapProj() As Boolean
        Get
            MapProj = bMapProj
        End Get
        Set(ByVal Value As Boolean)
            bMapProj = Value
        End Set
    End Property

    Public Property GridSys() As Boolean
        Get
            GridSys = bGrid
        End Get
        Set(ByVal Value As Boolean)
            bGrid = Value
        End Set
    End Property

    Public Property LocalPlanar() As Boolean
        Get
            LocalPlanar = bLocalP
        End Get
        Set(ByVal Value As Boolean)
            bLocalP = Value
        End Set
    End Property

    Public Function getParam(ByVal arrayIndex As Integer) As String
        getParam = ""
        If (arrayIndex > -1 And arrayIndex < nParam) Then
            getParam = sParams(arrayIndex)
        End If
    End Function

    Public Sub setParam(ByVal arrayIndex As Integer, ByVal sTemp As String)
        If (arrayIndex > -1 And arrayIndex < nParam) Then
            sParams(arrayIndex) = sTemp
        End If
    End Sub

    Public Property MapProjName() As String
        Get
            MapProjName = sParams(0)
        End Get
        Set(ByVal Value As String)
            sParams(0) = Value
        End Set
    End Property

    Public Property GridName() As String
        Get
            GridName = sParams(0)
        End Get
        Set(ByVal Value As String)
            sParams(0) = Value
        End Set
    End Property

    Public Property GridProjName() As String
        Get
            GridProjName = sParams(1)
        End Get
        Set(ByVal Value As String)
            sParams(1) = Value
        End Set
    End Property

    Public Property LocalDesc() As String
        Get
            LocalDesc = sLocalDesc
        End Get
        Set(ByVal Value As String)
            sLocalDesc = Value
        End Set
    End Property

    Public Property LocalGeoRef() As String
        Get
            LocalGeoRef = sLocalGeoRef
        End Get
        Set(ByVal Value As String)
            sLocalGeoRef = Value
        End Set
    End Property

    Public Property Encoding() As String
        Get
            Encoding = sEncoding
        End Get
        Set(ByVal Value As String)
            sEncoding = Value
        End Set
    End Property

    Public Property CoorRep() As Boolean
        Get
            CoorRep = bCoord
        End Get
        Set(ByVal Value As Boolean)
            bCoord = Value
        End Set
    End Property

    Public Property BearingRep() As Boolean
        Get
            BearingRep = bBearing
        End Get
        Set(ByVal Value As Boolean)
            bBearing = Value
        End Set
    End Property

    Public Property Abscissa() As Decimal
        Get
            Abscissa = dAbscissa
        End Get
        Set(ByVal Value As Decimal)
            dAbscissa = Value
        End Set
    End Property

    Public Property Ordinate() As Decimal
        Get
            Ordinate = dOrdinate
        End Get
        Set(ByVal Value As Decimal)
            dOrdinate = Value
        End Set
    End Property

    Public Property DistanceRes() As Decimal
        Get
            DistanceRes = dDistRes
        End Get
        Set(ByVal Value As Decimal)
            dDistRes = Value
        End Set
    End Property

    Public Property BearingRes() As Decimal
        Get
            BearingRes = dBearingRes
        End Get
        Set(ByVal Value As Decimal)
            dBearingRes = Value
        End Set
    End Property

    Public Property BearingUnits() As String
        Get
            BearingUnits = sBearUnits
        End Get
        Set(ByVal Value As String)
            sBearUnits = Value
        End Set
    End Property

    Public Property BearingDir() As String
        Get
            BearingDir = sBearDirection
        End Get
        Set(ByVal Value As String)
            sBearDirection = Value
        End Set
    End Property

    Public Property BearingMerid() As String
        Get
            BearingMerid = sBearMerid
        End Get
        Set(ByVal Value As String)
            sBearMerid = Value
        End Set
    End Property

    Public Property PlanarUnits() As String
        Get
            PlanarUnits = sPlanarUnits
        End Get
        Set(ByVal Value As String)
            sPlanarUnits = Value
        End Set
    End Property
End Class
